package com.example.wac.service;

import com.example.wac.mail.ToEmail;
import com.example.wac.vo.ApiResult;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;

/**
 * @author wuancheng
 * @description
 * @date 2021-08-12 18:01:00
 */

public interface MailService {
    /**
     * rocket发送邮件
     * @param email
     */
    String rocketSendMail(ToEmail email) throws InterruptedException, RemotingException, MQClientException, MQBrokerException;

    /**
     * rocket通过监听发送邮件 1分钟内一个用户只许发1次
     * @param email
     * @return
     */
    String rocketListenSendMail(ToEmail email);

    /**
     * rocket通过监听发送邮件 1分钟内一个用户最多只许发3次
     * @param email
     * @return
     */
    ApiResult rocketListenSendMailCount(ToEmail email);
}
